﻿using UnityEngine;
using System.Collections;

public class Popup_AreaLevelUpReward : Popup_Base
{
	public UILabel kinaAmountLabel;

    public override void AwakeInit()
    {
        m_PopupSound = "UI_popup_reward";
    }

    public override void StartInit()
    {        
    }

    public override void UpdateScene()
    {
    }

    //public override void UpdateTouch()    // 정의 하면 ButtonTouch() 사용 불가
    //{
    //}

    public override void ButtonTouch(Collider collider)  // 버튼 터치 (터치 시작 끝 같은 오브젝트일때 터치 끝 시점에 호출)
    {
		if( collider.name.Contains("Popup_AreaLevelUpReward") )
		{
			PopupManager.PopPopup();
		}
    }

    public override void BackButton()
    {
    }

	public void SetKinaAmount()
	{
		kinaAmountLabel.text = GameData.Inst.regionLevel[UserData.Instance.userModel.regions.regionMap_Dic[WorldSceneManager.sentResearchAreaId.ToString()].regionLevel-1].levelupReward.ToString();
		StartCoroutine("Co_ClosePopup");
	}

	IEnumerator Co_ClosePopup()
	{
		yield return new WaitForSeconds(3f);

		PopupManager.PopPopup();
	}
}
